<?php
namespace Home\Controller;
use Think\Controller;

class DealmsgboardController extends  BaseController
{
	public function index(){
		
		$root = get_baseroot();
		
		$user =  $GLOBALS['user_info'];
		$root['session_id'] = \es_session::id();
		$user_id  = intval($user['id']);
		if ($user_id >0){
			////require APP_ROOT_PATH.'app/Lib/uc_func.php';
			require APP_ROOT_PATH.'app/Lib/uc.php';
			$root['user_login_status'] = 1;
			$loan_type_list = load_auto_cache("deal_loan_type_list");
	    	foreach($loan_type_list as $k=>$v){
	    		if($v['credits']!=""){
	    			$loan_type_list[$k]['credits'] = unserialize($v['credits']);
	    			if(!is_array($loan_type_list[$k]['credits'])){
						$loan_type_list[$k]['credits'] = array();
					}
	    		}
	    		else
	    			$loan_type_list[$k]['credits'] = array();
	    	}
	    	
	    	$root['usefulness_type_list'] = $loan_type_list;
	    	$root['user_info'] = $user;
			
			
		}else{
			$root['response_code'] = 0;
			$root['show_err'] ="未登录";
			$root['user_login_status'] = 0;
		}
		$root['program_title'] = "登记借款";
		output($root);		
	}
	
}
?>
